home comics writing pictures archive about

ServerSelector.xaml

Language: Extensible Application Markup Language
Last Modified: 2020-06-27 1:58:33 PM UTC
File Size: 4042 bytes
http://www.penguinstew.ca/example/dataviewer/View/ServerSelector.xaml
<view:DialogViewBase x:Class="DataViewer.View.ServerSelector"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:Penguin.MVVMBase.Converters;assembly=Penguin.MVVMBase"
xmlns:view="clr-namespace:Penguin.MVVMBase.ViewBase;assembly=Penguin.MVVMBase"
Title="ServerSelector" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight" ShowInTaskbar="False">
<Grid Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.Resources>
<BooleanToVisibilityConverter x:Key="VisibilityConverter" />
<conv:InverseVisibilityConverter x:Key="InverseVisibilityConverter" />
</Grid.Resources>
<!-- Server label -->
<TextBlock Height="23" Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Center"
Text="Server Name:" />
<!-- Server selector -->
<ComboBox Height="23" Width="120" Grid.Row="0" Grid.Column="1"
ItemsSource="{Binding Servers}"
SelectedItem="{Binding SelectedServer}" />
<!-- New database label -->
<TextBlock Height="23" Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Center"
Text="New Database:" />
<!-- New database checkbox -->
<CheckBox Grid.Row="1" Grid.Column="1"
VerticalAlignment="Center"
IsChecked="{Binding IsNewDatabase}" />
<!-- Database label -->
<TextBlock Height="23" Grid.Row="2" Grid.Column="0"
HorizontalAlignment="Center"
Text="Database:" />
<!-- New database name -->
<TextBox Height="23" Width="120" Grid.Row="2" Grid.Column="1"
Text="{Binding NewDatabaseName}"
Visibility="{Binding IsNewDatabase, Converter={StaticResource VisibilityConverter}}"/>
<!-- Database selector -->
<ComboBox Height="23" Width="120" Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding Databases}"
SelectedItem="{Binding SelectedDatabase}"
IsEnabled="{Binding IsServerSelected}"
Visibility="{Binding IsNewDatabase, Converter={StaticResource InverseVisibilityConverter}}"/>
<!-- Ok button -->
<Button Height="23" Width="75" Grid.Row="3" Grid.Column="0"
Content="OK"
Command="{Binding OkCommand}" />
<!-- Cancel button -->
<Button Height="23" Width="75" Grid.Row="3" Grid.Column="1"
Content="Cancel"
Command="{Binding CancelCommand}" />
<!-- Loading transparency -->
<Rectangle Grid.RowSpan="3" Grid.ColumnSpan="2"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Fill="DarkGray" Opacity="0.5"
Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}" />
<!-- Loading border, used to center -->
<Border Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="2" Margin="65,11"
VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}" >
<!-- Loading label -->
<TextBlock Text="Loading..." TextAlignment="Center"
Foreground="White" FontSize="16" />
</Border>
</Grid>
</view:DialogViewBase>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74